r = 1 gotdagger = 1 werewolf = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 19) AS STRING directions(1) = "EAST" directions(2) = "WEST OR SOUTH" directions(3) = "NORTH OR EAST" directions(4) = "NORTH, SOUTH, OR WEST" directions(5) = "EAST OR SOUTH" directions(6) = "EAST OR WEST" directions(7) = "WEST OR SOUTH" directions(8) = "NORTH OR SOUTH" directions(9) = "NORTH OR WEST" directions(10) = "EAST, WEST, OR SOUTH" directions(11) = "NORTH OR EAST" directions(12) = "NORTH OR SOUTH" directions(13) = "NORTH, EAST, OR WEST" directions(14) = "WEST" directions(15) = "EAST OR SOUTH" directions(16) = "NORTH OR SOUTH" directions(17) = "NORTH, EAST, OR WEST" directions(18) = "WEST" directions(19) = "EAST" PRINT "" PRINT "" PRINT "After a hard day at work, you decide the best way to relax is to take a walk" PRINT "in the park. There's been reports of a strange creature lurking in the park." PRINT "Eating small animals and attacking those who go at night. As the sunsets, you" PRINT "figure the heck with it. Your Hanferd and you don't care, you've earned a nice" PRINT "relaxing night of peace and quiet." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " Hanferd Adventures Ep. 2" PRINT " Hanferd Meets The Wolfman" PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2016" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 IF r = 10 THEN: GOSUB r10 IF r = 11 THEN: GOSUB r11 IF r = 12 THEN: GOSUB r12 IF r = 13 THEN: GOSUB r13 IF r = 14 THEN: GOSUB r14 IF r = 15 THEN: GOSUB r15 IF r = 16 THEN: GOSUB r16 IF r = 17 THEN: GOSUB r17 IF r = 18 THEN: GOSUB r18 IF r = 19 THEN: GOSUB r19 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotdagger = 1 THEN: PRINT "A silver dagger, a gift from your Grandpa." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 11 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 9 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 7: GOTO moved IF r = 13 THEN: r = 12: GOTO moved IF r = 12 THEN: r = 10: GOTO moved IF r = 17 THEN: r = 16: GOTO moved IF r = 16 THEN: r = 15: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 7: GOTO moved IF r = 11 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 9: GOTO moved IF r = 15 THEN: r = 13: GOTO moved IF r = 13 THEN: r = 14: GOTO moved IF r = 19 THEN: r = 17: GOTO moved IF r = 17 THEN: r = 18: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 11: GOTO moved IF r = 7 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 9: GOTO moved IF r = 10 THEN: r = 12: GOTO moved IF r = 12 THEN: r = 13: GOTO moved IF r = 15 THEN: r = 16: GOTO moved IF r = 16 THEN: r = 17: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 4 THEN: r = 3: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 9 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 11: GOTO moved IF r = 14 THEN: r = 13: GOTO moved IF r = 13 THEN: r = 15: GOTO moved IF r = 18 THEN: r = 17: GOTO moved IF r = 17 THEN: r = 19: GOTO moved END IF IF (cmd$ = "EXAMINE WEREWOLF") AND r = 18 THEN CLS PRINT "She stands about seven feet tall. Her fur glisten's in the moonlight." PRINT "Her eye's glow a bright yellow, as she growls at you. She looks hungry." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO WEREWOLF") AND r = 18 THEN CLS PRINT "It let's out a might roar that makes the hair on the back of your neck" PRINT "stand up on edge. Maybe this wasn't such a good idea?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE DAGGER") AND gotdagger = 1 THEN CLS PRINT "A gift from your grandfather from the war. The handle is crafted from" PRINT "ivory and the blade is deadly sharp and made from silver. A rad thing" PRINT "to have." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE DAGGER") AND gotdagger = 1 AND r = 18 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "REASON WITH IT") AND r = 18 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE STATUE") AND r = 5 THEN CLS PRINT "A statue of a man being torn to shreds by a Werewolf...who wanted" PRINT "this? Oh well, better get a walking." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF '''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "EXAMINE OLD MAN") AND r = 8 THEN CLS PRINT "An old man walking alone in the park talking to himself. How strange!" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE DRUNK") AND r = 12 THEN CLS PRINT "A poorly dressed man drinking a fine vintage of wine. You don't" PRINT "pay attention to the fact he wet himself." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO OLD MAN") AND r = 8 THEN CLS PRINT "Don't talk to me, strange thing's a foot." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO DRUNK") AND r = 12 THEN CLS PRINT "Don't you hear them? They call to us, they want to take over us." PRINT "The Lizard people, they want to harvest our flesh, to power they're" PRINT "space ships and invade..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE CAT") AND r = 16 THEN CLS PRINT "A nice older black cat, it's up in a tree, and gives you a creepy" PRINT "look. Though it should scare you, you feel a warm and fuzzy." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO CAT") AND r = 16 THEN CLS PRINT "...hiss...hiss...groan..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "A cold dark night in the middle of your local park. Just an" PRINT "average relaxing night in Sweden." RETURN r2: PRINT "A full moon gives life to the once dead darkness. You feel as if" PRINT "your being watched." RETURN r3: PRINT "The old paved path begin's to grow with age. Cracks and with the" PRINT "odd weed growing through without no one caring." RETURN r4: PRINT "A small pond rests in front of you. You feel at one here. The hassle" PRINT "of life doesn't seem to bother you anymore." RETURN r5: PRINT "You see a statue resting off the path. Looks as if someone planted" PRINT "flowers around it, but they haven't grown yet." PRINT "" PRINT "EXAMINE STATUE" RETURN r6: PRINT "Silence, not a single sound could be heard minus your footsteps." RETURN r7: PRINT "You stop frozen in your tracks...what was that? You could swear you" PRINT "just heard someone moan in pain." RETURN r8: PRINT "You come across an old man, quickly making his way past you, his face" PRINT "is pale, and he looks upset." PRINT "" PRINT "EXAMINE OLD MAN or TALK TO OLD MAN" RETURN r9: PRINT "You notice that the moon begin's to be covered by the blanket of clouds." PRINT "Off in the distance you hear the scream of a woman. Maybe, the rumors" PRINT "were true?" RETURN r10: PRINT "Another path, you calm yourself down and figure what the heck." RETURN r11: PRINT "The pond sure is nice this time of night. I wonder just what lurks" PRINT "within it?" RETURN r12: PRINT "The moon is at it's highest peak and is strangely larger then you have" PRINT "ever seen before. Like it's calling out to something in the night." PRINT "Suddenly, from out of the darkness stumbles forth a Drunk man." PRINT "" PRINT "EXAMINE DRUNK or TALK TO DRUNK" RETURN r13: PRINT "A rustling comes from the bushes beside you. Quickly you turn to find" PRINT "that it's nothing but the wind." RETURN r14: PRINT "A scream echoes out through the park. Nothing but a moment of sheer" PRINT "panic over comes you. The thought of this being the end makes you sick" PRINT "to your stomach." RETURN r15: PRINT "The cold night air embraces you like a mother holding her child." RETURN r16: PRINT "While a light fog begin's to roll in. You can hear what could only" PRINT "be described as a Cat growling in defense. Trying to ward off others." PRINT "" PRINT "EXAMINE CAT or TALK TO CAT" RETURN r17: PRINT "A strong smell of wet dog fills the air. You feel as if it's going to" PRINT "make you sick, if you stick around any longer." RETURN r18: PRINT "There...standing before you, is the beast that has been behind all" PRINT "these killing's...it's a Werewolf..." PRINT "" PRINT "EXAMINE WEREWOLF or TALK TO WEREWOLF or REASON WITH IT or USE DAGGER" RETURN r19: PRINT "You are standing at a pile of tree's and small dead animals blocking" PRINT "your path...wonderful." RETURN win: COLOR 7, 0 CLS PRINT "You quickly draw take out your dagger and aim for the beasts heart." PRINT "This causes the Werewolf to charge at you with the speed of a train." PRINT "Without a moment to spare, you plunge the dagger into the beast." PRINT "A few moments pass, as the beast howls in pain and stumbles back into" PRINT "the darkness. You take a few steps forward and discover the Werewolf" PRINT "was actually a woman...Mrs. Gold, heiress to the steel mill in town." PRINT "How could this have happened? There is more to this mystery then" PRINT "meets the eye." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 7, 0 CLS PRINT "In some attempt to reason with the beast, it lunges at you" PRINT "and knocks you to the ground. Before it takes your life, it" PRINT "chuckles in your face and murders you upon the path for the" PRINT "others to discover." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "The light of the morning sun erases the darkness from the landscape." PRINT "Before you know it the beast vanishes from sight and escapes from" PRINT "the park. You are left alone to wonder just who or what that creature" PRINT "is?" _DISPLAY END END SUB